import Login from '@/views/login'
import TenantList from '@/views/tenant'
import UserList from '@/views/user'
import FeedbackList from '@/views/feedback'
import Overview from '@/views/overview'
import Dashboard from '@/views/dashboard'
import Alert from '@/views/alert'
import Setting from '@/views/setting'
import Main from '@/views/main'
import Vote from '@/views/vote'
import Rate from '@/views/vote/Rate'
import Category from '@/views/vote/Category'
import Advice from '@/views/vote/Advice'
import VueRouter from 'vue-router';
export const routes = [
  { path: '/login', name: '登录', component: Login, hidden: true},
  { path: '/vote', name: '评价', component: Vote, hidden: true,
    children: [
      { path: 'rate', name: '评分', component: Rate, hidden: true},
      { path: 'category', name: '分类', component: Category, hidden: true},
      { path: 'advice', name: '建议', component: Advice, hidden: true}
    ]
  },
  { path: '', name: '', component: Main,
    children: [
      { path: '/overview', name: '大数据分析', component: Overview, roles: ['ADMIN', 'MANAGER']},
      { path: '/dashboard', name: '分店详情', component: Dashboard, roles: ['ADMIN', 'MANAGER']},
      { path: '/tenant-list', name: '商户管理', component: TenantList, roles: ['ADMIN']},
      { path: '/user-list', name: '用户管理', component: UserList, roles: ['ADMIN']},
      { path: '/feedback-list', name: '反馈管理', component: FeedbackList, roles: ['ADMIN', 'MANAGER']},
      { path: '/alert', name: '实时预警', component: Alert, roles: ['ADMIN', 'MANAGER']},
      { path: '/setting', name: '设置', component: Setting, roles: ['ADMIN', 'MANAGER']}
    ]
  }
]

export default new VueRouter({
  routes,
  mode: 'history'
})